package cn.bocweb.spinning.view.dialog;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.Button;

import cn.bocweb.spinning.R;

/**
 * Created by Administrator on 2016/12/7.
 */

public class ExerciseFinishDialog extends AlertDialog {
    OnClickListener onClickListener;

    public ExerciseFinishDialog(Context context) {

        super(context);
    }

    public void setOnClickListener(OnClickListener onClickListener) {
        this.onClickListener = onClickListener;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_exercise_finish);
        Button btnContinue = (Button) findViewById(R.id.btn_continue);
        Button btnExit = (Button) findViewById(R.id.btn_exit);
        btnContinue.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        btnExit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onClickListener.click(v);
            }
        });
    }

    public interface OnClickListener {
        void click(View v);

    }

}
